<?php
	if(!defined("IN_APP"))
	{
		exit;
	}
	
	if(!adminpermission('N','120000'))
	{
		echo '无权查看!';
		exit;
	}
	
	$method = getParam('m','get','list');
	
	$parm = requestArrayParm($_REQUEST);
	
	unset($wheres,$ptlist);
	$wheres['status'] = '2';
	$sorts['addtime'] = 'desc';
	$resData = _SqlTool::getList('pingtai',$wheres,$pages,$sorts);
	foreach ($resData as $k => $v)
	{
		$ptlist[] = $v;
	}
	
	unset($where);
	$where['type'] = 'index';
		
	$tuijian = _SqlTool::getInfo('tuijian', $where);
	
	if(!empty($tuijian))
	{
		$items = json_decode($tuijian['content'],TRUE);
		
		foreach ($items as $k => $v)
		{
			unset($temp);
			unset($query);
			$query['id'] = $v;
			$chanpin = _SqlTool::getInfo('chanpin', $query);
			$temp['id'] = $chanpin['id'];
			$temp['cp_name'] = $chanpin['cp_mc'];
			unset($query);
			$query['id'] = $chanpin['pt_id'];
			$pingtai = _SqlTool::getInfo('pingtai', $query);
			$temp['pt_name'] = $pingtai['pt_name'];
			$list[] = $temp;
		}
	}
	
	include renderTemplate('neirong/list');
	
	